﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Text;

namespace Fdb.Model
{
    /// <summary>
    /// 执行结果类
    /// </summary>
    public class ExecuteResult
    {
        private int _ID;

        private bool _success = true;

        private string _resultString;

        private string _sql;

        private bool _isAdd;

        private string _ResultCode;

        private DbConnection _DbConnection;

        private DbTransaction _DbTransaction;

        /// <summary>
        /// 记录编号
        /// </summary>
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        /// <summary>
        /// 执行成功或失败
        /// </summary>
        public bool Success
        {
            set
            {
                this._success = value;
            }

            get
            {
                return this._success;
            }
        }

        /// <summary>
        /// 结果描述
        /// </summary>
        public string ResultString
        {
            set
            {
                this._resultString = value;
            }

            get
            {
                return this._resultString;
            }
        }

        /// <summary>
        /// 执行的SQL语句
        /// </summary>
        public string Sql
        {
            set
            {
                this._sql = value;
            }

            get
            {
                return this._sql;
            }
        }

        /// <summary>
        /// 是否是添加操作
        /// </summary>
        public bool IsAdd
        {
            get { return _isAdd; }
            set { _isAdd = value; }
        }

        public string ResultCode
        {
            set
            {
                this._ResultCode = value;
            }

            get
            {
                return this._ResultCode;
            }
        }

        /// <summary>
        /// 数据库连接对象
        /// </summary>
        public DbConnection DbConnection
        {
            get { return _DbConnection; }
            set { _DbConnection = value; }
        }

        /// <summary>
        /// 事务对象
        /// </summary>
        public DbTransaction DbTransaction
        {
            get { return _DbTransaction; }
            set { _DbTransaction = value; }
        }
    }
}
